package com.sdppf.dao.impl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.sdppf.dao.RoleDao;
import com.sdppf.domain.Role;

public class RoleDaoImpl extends HibernateDaoSupport implements RoleDao {

	@Override
	public void deleteRole(Role role) {
		this.getHibernateTemplate().delete(role);
	}

	@Override
	public List<Role> queryRoles() {
		return this.getHibernateTemplate().find("from Role");
	}

	@Override
	public void saveRole(Role role) {
		this.getHibernateTemplate().save(role);
	}

	@Override
	public void updateRole(Role role) {
		this.getHibernateTemplate().update(role);
	}

	@Override
	public Role queryRole(int roleId) {
		return (Role) this.getHibernateTemplate().get(Role.class, roleId);
	}

}
